package com.zhangtai.modules.service.contract;


import com.zhangtai.modules.dto.ContractRecordDto;
import com.zhangtai.modules.entity.contract.ContractRecordEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-10-20 17:57:00
 */

public interface ContractRecordService {

    @GetMapping("/findContractRecordList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult<ContractRecordDto> getList(@RequestParam(value = "code", required = false) String code,
                                          @RequestParam(value = "name", required = false) String name,
                                          @RequestParam(value = "orgId", required = false) List<Long> orgId,
                                          @RequestParam(value = "unitId", required = false) List<Long> unitId,
                                          @RequestParam(value = "contractType", required = false) Integer contractType,
                                          @RequestParam(value = "contractTimeType", required = false) Integer contractTimeType,
                                          @RequestParam(value = "status", required = false) Integer status,
                                          @RequestParam(value = "contractEndDate", required = false)String contractEndDate,
                                          @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                          @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                          @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/infoContractRecord")
    @ApiOperation(value = "根据id查找")
    ContractRecordEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveContractRecord")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody ContractRecordEntity entity);

    void removeRecord(Long oid,Integer kind);

    @PostMapping("/updateContractRecord")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody ContractRecordEntity entity);

    @GetMapping("/deleteOneContractRecord")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteContractRecords")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

